<template>
	<div class='container'>
		<div class="batch-add-footer">
			<el-button @click="onAddRowForEl" type="primary">
				添加行
			</el-button>
		</div>
		<BatchAdd ref="elBatchAdd" :formData="formData" :titleList="titleList" :height="280"></BatchAdd>
	</div>
</template>

<script setup>
import BatchAdd from './BatchAdd.vue'
import { ref } from 'vue'

const elBatchAdd=ref(null)
const titleList = ref([
	{
		title: "ID",
		type: "index",
		width: 60,
		fixed: "left",
	},
	{
		title: "姓名",
		key: "name",
	},
	{
		title: "年龄",
		key: "age",
	},
	{
		title: "身高",
		key: "heigh",
	},
	{
		title: "性别",
		slot: "sex",
		width: 100,
	},
	{
		title: "爱好",
		key: "aihao",
	},
	{
		title: "特长",
		key: "techang",
	},
	{
		title: "地址",
		key: "dress",
	},
	{
		title: "操作",
		slot: "action",
		width: 60,
		fixed: "right",
	},
])
const formData = ref({
	name: "",
	age: "",
	heigh: "",
	sex: "1",
	dress: "",
	aihao: "",
	techang: "",
})

const  onAddRowForEl=()=> {
	elBatchAdd.value.onBatchAdd();
}
</script>
<style lang='less' scoped>
.container {}
</style>
